import { http, http_api } from '../utils/request.js'


// 请求数据库user信息
export const getUser = (userdata) => {
    return http.post('/login/getUser', userdata)
}

// 向数据库注册user信息
export const registerUser = (userdata) => {
    return http.post('/register/registerUser', userdata)
}

// 请求首页数据
export const getData = () => {
    // 返回一个promise对象
    return http.get('/import/getData')
}

// 获取ip信息
export const getIP = () => {
    return http_api.get('ifconfig.me/ip')
}

// 获取地址
export const getAddress = (ip) => {
    return http_api.get('www.fkcoder.com/ip?ip=' + ip + '&json=true')
}